[qt] Split text by whitespaces

Posted by sterh on Stack Overflow See other posts from Stack Overflow or by sterh
Published on 2010-03-14T14:32:27Z Indexed on 2010/03/14 14:35 UTC
Read the original article Hit count: 141

Filed under:

Hi to all. I have text file with some text information and i need to split this text at spaces and all word push into List.

I make so:

 QStringList list = line.split(" ");

  for (int i = 0; i < list.count(); i++){

      table.push_back(list[i]);
      this->ui->textEdit->setText(list[i]);
  }

In line i have my text. But when i test this code i get all text, but not by the word.

Thank you.

© Stack Overflow or respective owner

Related posts about qt